gdksurface-win32.c: Fix up popup placement
authorChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 16 Jun 2021 04:24:47 +0000 (12:24 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 16 Jun 2021 08:25:29 +0000 (16:25 +0800)
commitba7ec29dc0c543a305f8a854641dbef6dc30f1a5
tree21cd745c5d0e5c4d65ee778ef6aaefcf4598f839
parent85b595bd14927173e4c78da4f4fa2f9988a14e13
gdksurface-win32.c: Fix up popup placement

If we are undergoing a surface move, just apply the next_layout anyways,
even if we are not moving a toplevel surface.

Update the way how we obtain the x and y coordinates of a surface, if it
is a toplevel, apply the x and y coordinates from the results from we
obtained the underlying Win32 HWND, as we did before.  But if it is a
popup, use gdk_win32_surface_get_geometry() to obtain the correct x and
y coordinates to place our popup surface.

Also correct how we compute the shadow dimensions, and the final popup
rectangle as we attempt to layout the popup surface, since GDK-Win32
keeps track of the shadow dimensions in system (unscaled) units, not GDK
units.

Fixes issue #3793.
gdk/win32/gdksurface-win32.c